<template>
	<view>
		<view class="container">
			<!-- 用户信息 -->
			<view class="userInfoBox rank">
				<view class="userInfo">
					<view class="infoBox" :style="'margin-top:'+ navbar.bottom + 'px;'">
						<navigator :url="$com.pathLogin(getPage.user, logged)" hover-class="none">
							<view class="avatar">
								<image :src="userInfo.user_model.head_url ? 
									$com.imageAvatar(userInfo.user_model.head_url) : 
									getImage.avatar" mode="aspectFill" @tap="goProfile" />
							</view>
						</navigator>
						<view class="info">
							<view class="userName">
								{{ userInfo.user_model != null ? nickname : '去登录' }}
							</view>
							<view class="shop_tag">{{rankname}}</view>
						</view>
					</view>
				</view>
				<view class="pending">
					<van-row v-if="userData.shop != null">
						<!-- <van-col span="6" @tap.native="opentixian">
							<view hover-class="none">
								<view class="count">
									{{ userInfo.user_model.user_money ? userInfo.user_model.user_money : 0 }}
								</view>
								<view class="ext">账户余额</view>
							</view>
						</van-col> -->
						<van-col span="8">
							<navigator @tap="shopGoFun(getPage.collection)" hover-class="none">
								<view class="count">{{ userData.fav_shop_count ? userData.fav_shop_count : 0 }}</view>
								<view class="ext">收藏</view>
							</navigator>
						</van-col>
						<van-col span="8">
							<!-- <van-col span="8" @tap.native="openfenhong"> -->
							<view hover-class="none">
								<view class="count">{{ userData.rewards ? userData.rewards : 0 }}</view>
								<view class="ext">访问量</view>
							</view>
						</van-col>
						<van-col span="8">
							<view @tap="shopGoFun(getPage.baoguang)" hover-class="none">
								<view class="count">{{ userData.shop.baoguang ? userData.shop.baoguang : 0 }}</view>
								<view class="ext">曝光量</view>
							</view>
						</van-col>
					</van-row>
				</view>
				<view class="shengjipanel" v-if="userData.shop != null && userData.showreg">
					<view class="sjinfo">{{ vipname }} | {{ endtime }}</view>
					<view class="goShengji" @click="shopGoFun(getPage.vip)">去升级</view>
				</view>
			</view>

			<!-- 我的订单 -->
			<view class="panel" style="margin-top: -25px; display: none">
				<van-cell is-link link-type="navigateTo" title="我的订单" value="查看全部订单"
					:url="$com.pathLogin(getPage.userOrder + '?id=0', logged)" />
				<view class="order">
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userOrder + '?id=1', logged)" hover-class="none">
							<van-icon :info="userData.wait_pay ? userData.wait_pay : ''" size="30px"
								:name="getImage.userOrderIcon1" />
							<view class="ext">待付款</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userOrder + '?id=2', logged)" hover-class="none">
							<van-icon :info="userData.wait_shipping ? userData.wait_shipping : ''" size="30px"
								:name="getImage.userOrderIcon2" />
							<view class="ext">待发货</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userOrder + '?id=3', logged)" hover-class="none">
							<van-icon :info="userData.wait_recive ? userData.wait_recive : ''" size="30px"
								:name="getImage.userOrderIcon3" />
							<view class="ext">待收货</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userOrder + '?id=4', logged)" hover-class="none">
							<van-icon size="30px" :name="getImage.userOrderIcon5" />
							<view class="ext">已完成</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userOrder + '?id=5', logged)" hover-class="none">
							<van-icon size="30px" :name="getImage.userOrderIcon4" />
							<view class="ext">已关闭</view>
						</navigator>
					</view>
				</view>
			</view>

			<view class="panel" style="margin-top: -25px; display: none">
				<van-cell is-link link-type="navigateTo" title="我的订单" value="查看全部订单"
					:url="$com.pathLogin(getPage.userbdOrder + '?id=0', logged)" />
				<view class="order">
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userbdOrder + '?id=1', logged)" hover-class="none">
							<van-icon :info="userData.bd_wait_pay ? userData.bd_wait_pay : ''" size="30px"
								:name="getImage.bduserOrderIcon1" />
							<view class="ext">待付款</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userbdOrder + '?id=2', logged)" hover-class="none">
							<van-icon :info="userData.bd_wait_shipping ? userData.bd_wait_shipping : ''" size="30px"
								:name="getImage.bduserOrderIcon2" />
							<view class="ext">待发货</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userbdOrder + '?id=3', logged)" hover-class="none">
							<van-icon :info="userData.bd_wait_recive ? userData.bd_wait_recive : ''" size="30px"
								:name="getImage.bduserOrderIcon3" />
							<view class="ext">待收货</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userbdOrder + '?id=4', logged)" hover-class="none">
							<van-icon size="30px" :name="getImage.bduserOrderIcon5" />
							<view class="ext">已完成</view>
						</navigator>
					</view>
					<view class="item">
						<navigator :url="$com.pathLogin(getPage.userbdOrder + '?id=5', logged)" hover-class="none">
							<van-icon size="30px" :name="getImage.bduserOrderIcon4" />
							<view class="ext">已关闭</view>
						</navigator>
					</view>
				</view>
			</view>

			<!-- 普通用户 -->
			<template v-if="userData.shop == null">
				<view class="panel_top">
					<view class="panel_top_box" @tap="goCoupon">
						<image :src="$com.imageOSS('xuqiu/m17288749920003865.png')" style="width: 100%; height: 100%">
						</image>
					</view>
					<view class="panel_top_box right_hd_zx">
						<view class="right_box right_top" @tap="goChoujiang">
							<image :src="$com.imageOSS('xuqiu/m17288752190008553.png')"
								style="width: 100%; height: 100%"></image>
						</view>
						<view class="right_box right_bot" @tap="gozhuangxiu">
							<image :src="$com.imageOSS('xuqiu/m17288752370009430.png')"
								style="width: 100%; height: 100%"></image>
						</view>
					</view>
				</view>

				<!-- 账户余额/银行卡 -->
				<view class="user_mony_box">
					<view class="user_user_money">
						<view class="um_item useryue" @tap="goBalance">
							<view class="um_item_tit">账户余额(元)</view>
							<view class="um_item_cont" style="font-size: 28rpx; font-weight: 700">{{ user_money }}
							</view>
							<view class="poa_img img_mny">
								<image src="/static/img/mny.png" style="width: 100%; height: 100%" />
							</view>
						</view>
						<view class="um_item yhcard" @tap="gouserpoints">
							<view class="um_item_tit">积分</view>
							<view class="um_item_cont" style="font-size: 28rpx; font-weight: 700">
								{{ pay_points }}
							</view>
							<view class="poa_img img_yhk">
								<image src="/static/img/yhk.png" style="width: 100%; height: 100%" />
							</view>
						</view>
					</view>
				</view>

				<!-- 用户-收藏/浏览记录/商家入驻 -->
				<view class="panel">
					<view class="order">
						<view class="item" @tap="handleNavigate('collection')">
							<view class="order_jb" v-if="nullShopJbData.collection"></view>
							<navigator :url="$com.pathLogin(getPage.collection, logged)" hover-class="none">
								<van-icon size="25px"
									name="https://keju123.oss-cn-shanghai.aliyuncs.com/xuqiu/m17288754910005588.png"
									custom-class="menusc" />
								<view class="ext">我的收藏</view>
							</navigator>
						</view>
						<view class="item" @tap="handleNavigate('zuji')">
							<view class="order_jb" v-if="nullShopJbData.zuji"></view>
							<navigator :url="$com.pathLogin(getPage.zuji, logged)" hover-class="none">
								<van-icon size="25px"
									name="https://keju123.oss-cn-shanghai.aliyuncs.com/xuqiu/m17288755190003928.png"
									custom-class="menuzuji" />
								<view class="ext">浏览记录</view>
							</navigator>
						</view>
						<view class="item" @tap="handleNavigate('beforeShenqing')">
							<view class="order_jb" v-if="nullShopJbData.beforeShenqing"></view>
							<navigator :url="$com.pathLogin(getPage.beforeShenqing, logged)" hover-class="none">
								<van-icon size="25px"
									name="https://keju123.oss-cn-shanghai.aliyuncs.com/xuqiu/m17288755340003314.png"
									custom-class="menuicon" />
								<view class="ext">商家入驻</view>
							</navigator>
						</view>
					</view>
				</view>

				<!-- 常用功能 -->
				<view class="panel">
					<view class="panel_title">常用功能</view>
					<van-row custom-class="tools shop_tools">
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.userProfile"></view>
							<navigator @tap="handleNavigate('userProfile')"
								:url="$com.pathLogin(getPage.userProfile, logged)" hover-class="none">
								<van-icon size="24px" :name="getImage.userToolIcon4" />
								<view class="ext">账户信息</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.useryhk"></view>
							<navigator @tap="handleNavigate('useryhk')" :url="$com.pathLogin(getPage.useryhk, logged)"
								hover-class="none">
								<van-icon size="24px" :name="getImage.userToolIcon4" />
								<view class="ext">银行卡</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.orderuser"></view>
							<navigator @tap="handleNavigate('orderuser')" hover-class="none"
								:url="$com.pathLogin(getPage.orderuser, logged)">
								<van-icon size="24px" name="/static/img/myhomezx.png" />
								<view class="ext">我家装修</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.password"></view>
							<navigator @tap="handleNavigate('password')" :url="$com.pathLogin(getPage.password, logged)"
								hover-class="none">
								<van-icon size="24px" :name="getImage.userToolIcon5" />
								<view class="ext">账号安全</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.myxuqiu"></view>
							<navigator @tap="handleNavigate('myxuqiu')" :url="$com.pathLogin(getPage.myxuqiu, logged)"
								hover-class="none">
								<van-icon size="24px" name="/static/img/u_xuqiu.png" />
								<view class="ext">需求管理</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.couponList"></view>
							<navigator @tap="handleNavigate('couponList')"
								:url="$com.pathLogin(getPage.couponList, logged)" hover-class="none">
								<van-icon size="24px" :name="getImage.couponicon" />
								<view class="ext">优惠券</view>
							</navigator>
						</van-col>
						<van-col span="6" v-if="userData.choujiang">
							<view class="poa_jb" v-if="nullShopJbData.choujiang"></view>
							<navigator @tap="handleNavigate('choujiang')"
								:url="$com.pathLogin(getPage.choujiang, logged)" hover-class="none">
								<van-icon size="24px" name="/static/img/u_choujiang.png" />
								<view class="ext">抽奖</view>
							</navigator>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="nullShopJbData.address"></view>
							<navigator @tap="handleNavigate('address')" :url="$com.pathLogin(getPage.address, logged)"
								hover-class="none">
								<van-icon size="24px" name="/static/img/user_adr.png" />
								<view class="ext">收货地址</view>
							</navigator>
						</van-col>
						<van-col span="6" v-if="userData.yg">
							<view class="poa_jb" v-if="nullShopJbData.yuangong"></view>
							<navigator @tap="handleNavigate('yuangong')"
								:url="utils.pathLogin(getPage.yuangong, logged)" hover-class="none">
								<van-icon size="24px" name="/static/img/gstd.png" />
								<view class="ext">员工</view>
							</navigator>
						</van-col>
						<!-- #ifdef MP-WEIXIN -->
						<van-col span="6">
							<view hover-class="none">
								<button open-type="contact" :plain="true" class="nav-custom">
									<van-icon size="24px" name="/static/img/u-kefu2.png" />
									<view class="ext">联系客服</view>
								</button>
							</view>
						</van-col>
						<!-- #endif -->
					</van-row>
				</view>
			</template>

			<!-- 商家 -->
			<template v-if="userData.shop != null">

				<view class="mony_box">
					<view class="user_money">
						<view class="um_item useryue" @tap="goBalance">
							<view class="um_item_tit">账户余额(元)</view>
							<view class="um_item_cont" style="font-size: 28rpx; font-weight: 700">{{ user_money }}
							</view>
							<view class="poa_img img_mny">
								<image src="/static/img/mny.png" style="width: 100%; height: 100%" />
							</view>
						</view>
						<view class="um_item yhcard" @tap="shopGoFun(getPage.userpoints)">
							<view class="um_item_tit">积分</view>
							<view class="um_item_cont" style="font-size: 28rpx; font-weight: 700">
								{{ pay_points }}
							</view>
							<view class="poa_img img_yhk">
								<image src="/static/img/yhk.png" style="width: 100%; height: 100%" />
							</view>
						</view>
					</view>
				</view>

				<!-- banner -->
				<view class="banner_box">
					<view class="botZtList">
						<swiper class="swiper" :autoplay="true" :circular="true" @change="botZtListChange">
							<block v-for="(item, index) in botZtList" :key="index">
								<swiper-item>
									<view @click="golink(item.adurl)" style="border-radius: 16rpx; overflow: hidden">
										<image :class="hfListIndex === index ? 'active' : ''"
											:src="$com.imageOSS(item.adimg)" mode="aspectFill" />
									</view>
								</swiper-item>
							</block>
						</swiper>
					</view>
				</view>

				<!-- 应用中心 -->
				<view class="panel" style="margin-top: 20rpx">
					<view class="panel_title">应用中心</view>
					<view class="yingyong_row">
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.userProfile"></view>
							<view @click="shopGoFun(getPage.userProfile,'userProfile')">
								<van-icon size="24px" :name="getImage.userToolIcon4" />
								<view class="ext">账户信息</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.useryhk"></view>
							<view @click="shopGoFun(getPage.useryhk,'useryhk')">
								<van-icon size="24px" :name="getImage.userToolIcon4" />
								<view class="ext">银行卡</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.collection"></view>
							<view @tap="shopGoFun(getPage.collection,'collection')">
								<van-icon size="24px" :name="getImage.userToolIcon1" />
								<view class="ext">我的收藏</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.zuji"></view>
							<view @tap="shopGoFun(getPage.zuji,'zuji')">
								<van-icon size="24px" :name="getImage.userToolIcon11" />
								<view class="ext">浏览记录</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.password"></view>
							<view @tap="shopGoFun(getPage.password,'password')">
								<van-icon size="24px" :name="getImage.userToolIcon5" />
								<view class="ext">账号安全</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.couponList"></view>
							<view @tap="shopGoFun(getPage.couponList,'couponList')">
								<van-icon size="24px" :name="getImage.couponicon" />
								<view class="ext">优惠券</view>
							</view>
						</view>
						<view class="yy_item" v-if="userData.yg">
							<view class="order_jb" v-if="shopJbData.yuangong"></view>
							<view @tap="shopGoFun(getPage.yuangong,'yuangong')">
								<van-icon size="24px" name="/static/img/gstd.png" />
								<view class="ext">员工</view>
							</view>
						</view>
						<view class="yy_item">
							<view class="order_jb" v-if="shopJbData.orderuser"></view>
							<view @tap="shopGoFun(getPage.orderuser,'orderuser')">
								<van-icon size="24px" name="/static/img/myhomezx.png" />
								<view class="ext">我家装修</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 商家操作手册 -->
				<view class="panel" v-if="userData.showreg">
					<view class="shop_sc">
						<image :src="$com.imageOSS('xuqiu/m17288705650006074.png')" style="width: 100%; height: 100%">
						</image>
						<view class="sc_btn_box">
							<view class="sc_btn" @click="golink('https://shop.keju123.com/list')">点击查看详情</view>
						</view>
					</view>
				</view>

				<!-- 商店管理 -->
				<view class="panel">
					<view class="panel_title">商店管理</view>
					<van-row custom-class="tools shop_tools">
						<van-col span="6" v-if="userData.shop.ShopType !== 2">
							<view class="poa_jb" v-if="shopJbData.yongjinShop"></view>
							<view @tap="shopGoFun(getPage.yongjinShop,'yongjinShop')">
								<van-icon size="28px" name="/static/img/yongjin.png" />
								<view class="ext">佣金折扣</view>
							</view>
						</van-col>
						<van-col span="6" v-if="userData.shop != null">
							<view class="poa_jb" v-if="shopJbData.mycase"></view>
							<view hover-class="none" @tap="shopGoFun(getPage.mycase,'mycase')">
								<van-icon size="26px" :name="getImage.userToolIcon19" />
								<view class="ext shop_ect">上传案例</view>
							</view>
						</van-col>
						<van-col span="6" v-if="userData.shop != null">
							<view class="poa_jb" v-if="shopJbData.shopedit"></view>
							<view @tap="shopGoFun(getPage.shopedit,'shopedit')">
								<van-icon size="26px" :name="getImage.userToolIcon12" />
								<view class="ext shop_ect">店铺设置</view>
							</view>
						</van-col>
						<van-col span="6" v-if="parentid == 0">
							<view class="poa_jb" v-if="shopJbData.admin"></view>
							<view @tap="shopGoFun(getPage.admin,'admin')">
								<van-icon size="26px" name="/static/img/u-contacter.png" />
								<view class="ext shop_ect">子账户</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.companydetail"></view>
							<view @tap="shopGoFun(getPage.companydetail,'companydetail',userData.shop.ShopId)">
								<van-icon size="26px" name="/static/img/viewshop.png" />
								<view class="ext shop_ect">查看店铺</view>
							</view>
						</van-col>
						<van-col span="6"
							v-if="parentid == 0 && (userData.shop.ShopType == 2 || userData.shop.ShopType == 3)">
							<view class="poa_jb" v-if="shopJbData.myproductsCate"></view>
							<view @tap="shopGoFun(getPage.myproductsCate,'myproductsCate')">
								<van-icon size="26px"
									:name="'/static/img/' + (userData.shop.ShopType == 2 ? 'u-shopping.png' : 'gstd.png')" />
								<view class="ext shop_ect">{{ userData.shop.ShopType == 2 ? '商品管理' : '公司团队' }}</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.pingjia"></view>
							<view open-type="switchTab"
								@tap="shopGoFun(getPage.pingjia,'pingjia',userData.shop.ShopId)">
								<van-icon size="26px" name="/static/img/dppj.png" />
								<view class="ext shop_ect">店铺评价</view>
							</view>
						</van-col>
						<!-- 建材门店独有 -->
						<van-col span="6" v-if="userData.shop.ShopType == 2">
							<view class="poa_jb" v-if="shopJbData.sekalist"></view>
							<view hover-class="none" @tap="shopGoFun(getPage.sekalist,'sekalist')">
								<van-icon size="26px" name="/static/img/seka.png" />
								<view class="ext shop_ect">色卡</view>
							</view>
						</van-col>
						<!-- 独立设计师才拥有此操作 -->
						<van-col span="6" v-if="userData.shop.ShopType == 4">
							<view class="poa_jb" v-if="shopJbData.desworks"></view>
							<view hover-class="none" @tap="shopGoFun(getPage.desworks,'desworks')">
								<van-icon size="26px" name="/static/img/upload_sheji.png" />
								<view class="ext shop_ect">上传设计作品</view>
							</view>
						</van-col>
						<van-col span="6" v-if="parentid == 0">
							<view class="poa_jb" v-if="shopJbData.shopDw"></view>
							<view @tap="getLocation('shopDw')">
								<van-icon size="26px" :name="getImage.userToolIcon2" />
								<view class="ext shop_ect">店铺定位</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.ordermanage"></view>
							<view @tap="shopGoFun(getPage.ordermanage,'ordermanage')">
								<van-icon size="26px" name="/static/img/order.png" />
								<view class="ext">订单管理</view>
							</view>
						</van-col>
					</van-row>
				</view>

				<!-- 资源中心 -->
				<view class="panel" style="margin-top: 30rpx">
					<view class="panel_title">资源中心</view>
					<van-row custom-class="tools shop_tools">
						<van-col span="6" v-if="false">
							<view class="poa_jb" v-if="shopJbData.dataCenter"></view>
							<view @tap="shopGoFun(getPage.dataCenter,'dataCenter')">
								<van-icon size="24px" name="/static/img/liuliang.png" />
								<view class="ext">数据中心</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.shareMy"></view>
							<view @tap="shopGoFun(getPage.shareMy,'shareMy')">
								<van-icon size="24px" name="/static/img/fxicon2.png" />
								<view class="ext">我分享过</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.shareUser"></view>
							<view @tap="shopGoFun(getPage.shareUser,'shareUser')">
								<van-icon size="24px" name="/static/img/fxicon.png" />
								<view class="ext">谁分享过</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_count" v-if="v_count > 0">{{ v_count }}</view>
							<view class="poa_jb" v-if="v_count == 0 && shopJbData.jingzhunUser"></view>
							<view @tap="shopGoFun(getPage.jingzhunUser,'jingzhunUser')">
								<van-icon size="24px" name="/static/img/jzyh.png" />
								<view class="ext">精准客户</view>
							</view>
						</van-col>
					</van-row>
				</view>

				<!-- 平台官方 -->
				<view class="panel" style="margin-top: 30rpx">
					<view class="panel_title">平台官方</view>
					<van-row custom-class="tools shop_tools">
						<!-- <van-col span="6" v-if="userData.showreg">
							<view class="poa_jb" v-if="shopJbData.putin"></view>
							<view open-type="switchTab" @tap="shopGoFun(getPage.putin,'putin')">
								<van-icon size="24px" name="/static/img/360.png" />
								<view class="ext">360全景拍摄</view>
							</view>
						</van-col> -->
						<van-col span="6" v-if="userData.showreg">
							<view class="poa_jb" v-if="shopJbData.cityPutin"></view>
							<view open-type="switchTab" @tap="shopGoFun(getPage.cityPutin,'cityPutin')">
								<van-icon size="24px" name="/static/img/ggtf.png" />
								<view class="ext">广告投放</view>
							</view>
						</van-col>
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.activitybm"></view>
							<view open-type="switchTab"
								@tap="shopGoFun(getPage.activitybm,'activitybm',userData.shop.ShopId)">
								<van-icon size="25px" name="/static/img/hdbm.png" />
								<view class="ext">活动报名</view>
							</view>
						</van-col>
						<van-col span="6" v-if="!userData.shop.renzheng">
							<view class="poa_jb" v-if="shopJbData.platform"></view>
							<view hover-class="none" @tap="shopGoFun(getPage.platform,'platform')">
								<van-icon size="22px" name="/static/img/renzheng.png" />
								<view class="ext shop_ect">平台认证</view>
							</view>
						</van-col>
						<!-- #ifdef MP-WEIXIN -->
						<van-col span="6">
							<view class="poa_jb" v-if="shopJbData.kefu"></view>
							<button open-type="contact" :plain="true" class="nav-custom" @tap="clearJb('kefu')">
								<view hover-class="none">
									<van-icon size="25px" name="/static/img/u-kefu.png" />
									<view class="ext">联系客服</view>
								</view>
							</button>
						</van-col>
						<!-- #endif -->
					</van-row>
				</view>

				<!-- <view style="height: 100px;"></view> -->

			</template>
			<!-- #ifdef MP-WEIXIN -->
			<uni-popup ref="infoRef" type="center">
				<view class="info_popup">
					<view class="infopop_t">完善后可体验更多功能</view>
					<view class="info_box">99%+用户选择使用微信头像和昵称便于使用</view>
					<van-cell center title="微信头像" title-width="150rpx" size="large">
						<button class="choose-avatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
							<image v-if="wxinfo.avatar" class="avatar-info" :src="$com.imageAvatar(wxinfo.avatar)"
								mode="scaleToFill" />
							<image v-else class="avatar-info avatar-default" src="/static/img/u-shejishi.png"
								mode="scaleToFill"></image>
						</button>
					</van-cell>

					<van-cell center title="微信昵称" title-width="150rpx" size="large">
						<input style="width: 100%; height: 50px" type="nickname" :value="wxinfo.nickname"
							@change="wxinputname" placeholder="请输入昵称" />
					</van-cell>
				</view>
			</uni-popup>
			<!-- #endif -->

			<uni-popup ref="newFKPopRef" type="center">
				<view class="pop_war">
					<view class="err_img">
						<image src="https://keju123.oss-cn-shanghai.aliyuncs.com/xuqiu/m17281957660001283.png"
							style='height:100%;width: 100%;' mode="widthFix" />
					</view>
					<view class="poa_close" @click="newFKPopupClose">
						<van-icon name="cross" size="20px" />
					</view>
					<view class="poa_text">您有新的客户访问店铺</view>
					<view class="poa_btn">
						<view class="err_btn">
							<view class="btn_text" @click="gotoJingzhun">点击查看精准客户</view>
						</view>
					</view>
				</view>
			</uni-popup>
		</view>
		<tab-bar ref="tabbar" :tabInd="4" :v_count="v_count"></tab-bar>
	</view>
</template>
<script>
	import {
		getPage,
		getImage
	} from '../../utils/config';
	import {
		imageCdn
	} from '../../utils/api';
	import {
		promisify,
		$toast,
		http,
		storage,
		SubscribeMessage
	} from '../../utils/utils';
	import wxApi from '../../utils/wxApi';
	import api from '../../utils/api';
	const app = getApp();
	export default {
		data() {
			return {
				getPage: getPage,
				getImage: getImage,
				initial: 0,
				userId: 0,
				userRank: 0,
				logged: 0,

				userInfo: {
					user_model: {
						head_url: ''
					}
				},

				navbar: {
					top: '',
					height: ''
				},

				userData: {
					shop: {
						baoguang: false,
						ShopType: 0,
						ShopId: '',
						renzheng: ''
					},

					fav_shop_count: false,
					rewards: false,
					showreg: '',
					wait_pay: false,
					wait_shipping: false,
					wait_recive: false,
					bd_wait_pay: false,
					bd_wait_shipping: false,
					bd_wait_recive: false,
					choujiang: '',
					yg: '',
					qrcode: ''
				},

				rankbg: '',
				rankname: '',
				nickname: '微信用户',
				myTime: null,

				wxinfo: {
					avatar: '',
					nickname: ''
				},

				iswxbind: false,
				bindwx: false,
				dialogConfirm: false,
				hfListIndex: 0,
				botZtListIndex: 0,
				botZtList: [],
				localInfo: '',
				beforeClose: '',
				selected: 0,
				number: '',
				shopid: '',
				name: '',
				address: '',
				latitude: '',
				longitude: '',
				user_model: '',
				vipname: '',
				endtime: '',
				parentid: '',
				user_money: '',
				bank: '',
				bank_img: '',
				isShow: false,
				v_count: 0,
				pay_points: 0,
				nullShopJbData: {
					collection: '',
					zuji: '',
					beforeShenqing: '',
					userProfile: '',
					useryhk: '',
					orderuser: '',
					password: '',
					myxuqiu: '',
					couponList: '',
					choujiang: '',
					address: '',
					yuangong: '',
					kefu: ''
				},

				key: '',

				shopJbData: {
					userProfile: '',
					useryhk: '',
					collection: '',
					zuji: '',
					password: '',
					couponList: '',
					yuangong: '',
					orderuser: '',
					yongjinShop: '',
					mycase: '',
					shopedit: '',
					admin: '',
					companydetail: '',
					myproductsCate: '',
					pingjia: '',
					sekalist: '',
					desworks: '',
					shopDw: '',
					ordermanage: '',
					dataCenter: '',
					shareMy: '',
					shareUser: '',
					jingzhunUser: '',
					putin: '',
					cityPutin: '',
					activitybm: '',
					platform: '',
					kefu: ''
				},
			}
		}
		/**
		 * 底部导航点击
		 */
		,
		onTabItemTap() {
			const {
				logged,
				initial
			} = this;
			if (!logged && initial) {
				//判断是否登录，记录登录态
				app.globalData
					.getLogin()
					.then((res) => {
						this.localInfo = res;
						this.logged = res.code;
						this.userId = res.data.user.user_id;
						this.userRank = res.data.user.user_rank;
						//获取页面数据
						this.getUserInfo(() => {
							let {
								localInfo,
								userInfo,
								userData
							} = this;
							//更新本地
							localInfo.data.user = userInfo.user_model;
							localInfo.data.shop = userData.shop;
							this.localInfo = localInfo;
							storage.set('userInfo', localInfo);
						});
					})
					.catch((res) => {
						//记录当前路径
						wxApi.setStartPage();
						this.logged = res
					});
			}
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad() {
			promisify(uni.getSystemInfo)().then((res) => {
				//获取右上角胶囊信息
				// #ifdef MP-WEIXIN
				this.navbar = uni.getMenuButtonBoundingClientRect()
				console.log("--------------", this.navbar)
				// #endif

				//获取右上角胶囊信息
				// #ifdef MP-TOUTIAO
				let navbar = uni.getMenuButtonBoundingClientRect()
				let CustomButton = tt.getCustomButtonBoundingClientRect()
				navbar.customWidth = CustomButton.customNavigation.width - 10
				navbar.marginLeft = CustomButton.customNavigation.marginLeft + 5
				this.navbar = navbar
				console.log("--------------", this.navbar)
				// #endif

				// #ifdef APP-PLUS
				this.navbar = menuButton
				// #endif
				this.window = res
			});
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady() {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow() {
			this.myTime = setInterval(function() {
				this.number = app.globalData.unReadMsg
			}, 5000)
			console.log('show___________________111');
			//判断是否登录
			app.globalData
				.getLogin()
				.then((res) => {
					console.log('show___________________', res);
					this.localInfo = res;
					this.logged = res.code;
					this.userId = res.data.user.user_id;
					this.userRank = res.data.user.user_rank;
					//获取页面数据
					this.getUserInfo(() => {
						let {
							localInfo,
							userInfo,
							userData
						} = this;
						//更新本地
						localInfo.data.user = userInfo.user_model;
						localInfo.data.shop = userData.shop;
						this.localInfo = localInfo;
						console.log('localInfo===========', localInfo);
						storage.set('userInfo', localInfo);
						// if (userInfo.user_model.user_rank == 2) {
						//   wx.setNavigationBarColor({
						//     frontColor: '#ffffff', // 必写项
						//     backgroundColor: '#e30020', // 必写项
						//   });
						// }

						// 角标
						console.log('this.data.userData.shop====', this.userData);
						console.log('this.data.userid====', this.userId);
						console.log('this.data.shopid====', this.shopid);
						if (userData.shop == null) {
							let key = 'nullShopJbData' + this.userId;
							let nullShopJbData = uni.getStorageSync(key);
							console.log('nullShopJbData===', nullShopJbData);
							this.key = key;
							if (nullShopJbData) {
								this.nullShopJbData = nullShopJbData;
							} else {
								let firstData = {
									collection: 1,
									zuji: 1,
									beforeShenqing: 1,
									userProfile: 1,
									useryhk: 1,
									orderuser: 1,
									password: 1,
									myxuqiu: 1,
									couponList: 1,
									choujiang: 1,
									address: 1,
									yuangong: 1,
									kefu: 1
								};
								this.nullShopJbData = firstData;
								uni.setStorageSync(key, firstData);
							}
						} else {
							let key = 'shopJbData' + this.shopid;
							this.key = key;
							let shopJbData = uni.getStorageSync(key);
							console.log('shopJbData===', shopJbData);
							if (shopJbData) {
								this.shopJbData = shopJbData;
							} else {
								let firstData = {
									userProfile: 1,
									useryhk: 1,
									collection: 1,
									zuji: 1,
									password: 1,
									couponList: 1,
									yuangong: 1,
									orderuser: 1,
									yongjinShop: 1,
									mycase: 1,
									shopedit: 1,
									admin: 1,
									companydetail: 1,
									myproductsCate: 1,
									pingjia: 1,
									sekalist: 1,
									desworks: 1,
									shopDw: 1,
									ordermanage: 1,
									dataCenter: 1,
									shareMy: 1,
									shareUser: 1,
									jingzhunUser: 1,
									putin: 1,
									cityPutin: 1,
									activitybm: 1,
									platform: 1,
									kefu: 1
								};
								this.shopJbData = firstData;
								uni.setStorageSync(key, firstData);
							}
						}
					});
				})
				.catch((res) => {
					this.logged = res
					this.goLogin();
				})
				.finally(() => {
					this.initial = 1;
				});
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide() {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload() {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh() {
			if (this.logged) {
				//抖动
				uni.vibrateShort();
				this.getUserInfo(() => {
					let {
						localInfo,
						userInfo,
						userData
					} = this;
					console.log(this);
					//更新本地
					localInfo.data.user = userInfo.user_model;
					localInfo.data.shop = userData.shop;
					this.localInfo = localInfo;
					storage.set('userInfo', localInfo);
					uni.stopPullDownRefresh();
				});
			} else {
				uni.stopPullDownRefresh();
			}
		},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom() {},
		methods: {

			botZtListChange(e) {
				this.botZtListIndex = e.detail.current
			},

			gouserpoints() {
				//#ifdef MP-WEIXIN
				wxApi.navigateTo(getPage.userpoints);
				//#endif
			},

			handleNavigate(name) {
				let {
					nullShopJbData,
					key
				} = this;
				console.log('name', name);
				if (nullShopJbData[name] == 1) {
					nullShopJbData[name] = 0;
					this.nullShopJbData = nullShopJbData;
					uni.setStorageSync(key, nullShopJbData);
				}
			},

			shopGoFun(goname, name, id) {
				console.log('goname', goname)
				let {
					shopJbData,
					key
				} = this;
				if (name && shopJbData[name] == 1) {
					shopJbData[name] = 0;
					this.shopJbData = shopJbData;
					uni.setStorageSync(key, shopJbData);
				}

				//#ifdef MP-WEIXIN
				SubscribeMessage().then(res => {
					console.log('resssssssss', res)
					wxApi.navigateTo(goname);
				})
				//#endif

				// #ifndef MP-WEIXIN
				if (goname == '/subPackages/pages/userpoints/userpoints' || goname ==
					'/subPackages/pages/vip/index') return
				if (id) {
					wxApi.navigateTo(goname, {
						id
					});
				} else {
					wxApi.navigateTo(goname);
				}
				//#endif
			},

			golink(url) {
				//转为小写并去除左右空格
				var str = url.toLowerCase()
				if (str != '') {
					if (str.indexOf('https') === 0 || str.indexOf('http') === 0) {
						wxApi.navigateTo('/pages/web/web?id=' + str)
					} else if (str.indexOf('mm://') == 0) {
						var array = str.split('_')
						if (array[0].replace('mm://', '') == 'shop') {
							wxApi.navigateTo('/pages/companydetail/index', {
								id: array[1],
							})
						}
					} else if (str.indexOf('ym://') == 0) {
						var url = str.replace("ym://", "");
						if (url.indexOf('subpackages') > 0) {
							url = url.replace("subpackages", "subPackages");
						}
						wxApi.navigateTo(url);
					} else {
						wxApi.navigateTo('/pages/goods/goods?id=' + str)
					}
				}
			},

			/**
			 * 跳转登录
			 */
			goLogin() {
				console.log('打印-跳转登录~~~')
				wxApi.setStartPage();
				wxApi.redirectTo(getPage.login);
			},

			clearJb(name) {
				console.log('eeeeeeeee', name);
				let {
					shopJbData,
					key
				} = this;
				if (name && shopJbData[name] == 1) {
					shopJbData[name] = 0;
					this.shopJbData = shopJbData;
					uni.setStorageSync(key, shopJbData);
				}
			},

			getgetLocationAwait() {
				uni.chooseLocation({
					success: function(res) {
						var name = res.name;
						var address = res.address;
						var latitude = res.latitude;
						var longitude = res.longitude;
						if (address != '') {
							//第二部分数据
							http.post(
								api.default, {
									data: {
										action: 'setshopweizhi',
										userid: that.userId,
										name: name,
										address: address,
										latitude: latitude,
										longitude: longitude
									}
								},
								false
							).then((res) => {
								console.log(res);
								$toast('设置位置成功');
							});
						}
						that.name = name;
						that.address = address;
						that.latitude = latitude;
						that.longitude = longitude;
					},
					complete(r) {
						console.log(r);
					}
				});
			},

			getLocation: function(name) {
				let {
					shopJbData,
					key
				} = this;
				if (name && shopJbData[name] == 1) {
					shopJbData[name] = 0;
					this.shopJbData = shopJbData;
					uni.setStorageSync(key, shopJbData);
				}
				var that = this;
				//#ifdef MP-WEIXIN
				SubscribeMessage().then(res => {
					this.getgetLocationAwait();
				})
				//#endif

				// #ifndef MP-WEIXIN
				this.getgetLocationAwait();
				// #endif
			},

			goPutin() {
				console.log('getPage.putin', getPage.putin);
				wxApi.navigateTo(getPage.putin);
			},

			/**
			 * 跳转个人中心
			 */
			goProfile() {
				// #ifdef MP-WEIXIN
				this.wxinfo.avatar = this.imageAvatar(this.userInfo.user_model.head_url) || null;
				this.wxinfo.nickname = this.nickname || '';
				this.$refs.infoRef.open();
				// #endif
			},

			// 查看店铺
			gocompanydetail(e) {
				const data = e.currentTarget.dataset || e.target.dataset;
				if (data.id) {
					wxApi.navigateTo(getPage.companydetail, {
						id: data.id
					});
				}
			},

			scantest() {
				uni.scanCode({
					onlyFromCamera: false,
					success: (res) => {
						const path = res.path;
						const scanType = res.scanType;
						console.log(res);
						console.log('path: ', path);
					}
				});
			},

			/**
			 * 获取用户信息
			 */
			getUserInfo(cb) {
				//显示导航条加载
				uni.showNavigationBarLoading();
				//第一部分数据
				http.post(
					api.default, {
						data: {
							action: 'getuserinfo',
							userid: this.userId
						}
					},
					false
				).then((res) => {
					const userInfo = res.data.data;
					console.log(userInfo);
					this.user_model = userInfo.user_model;
					if (userInfo.user_model.user_rank == 1) {
						this.rankname = '普通会员';
					} else if (userInfo.user_model.user_rank == 2) {
						this.rankname = '建材门店';
					} else if (userInfo.user_model.user_rank == 3) {
						this.rankname = '装修公司';
					} else if (userInfo.user_model.user_rank == 4) {
						this.rankname = '设计师';
					}
					//第二部分数据
					http.post(
						api.default, {
							data: {
								action: 'userdefault',
								userid: this.userId
							}
						},
						false
					).then((res) => {
						console.log(11111111111111, res.data.data);
						const userData = res.data.data;
						var nickname = '';

						this.userInfo = userInfo;
						this.userData = userData;
						this.vipname = userData.vipname;
						this.endtime = userData.endtime;
						this.parentid = userData.shop?.parentid;
						this.user_money = userData.user_money;
						this.bank = userData.bank;
						this.botZtList = userData.botZtList;
						this.v_count = userData.v_count;
						this.pay_points = userData.pay_points;

						app.globalData.v_count = this.v_count;
						if (userData.v_count > 0) {
							this.newFKPop = true;
						}
						if (userData.shop != null && userData.shop.ShopName != null) {
							nickname = userData.shop.ShopName;
						} else {
							nickname = userInfo.user_model.nickname;
						}
						this.nickname = nickname;
						console.log(userInfo);
						if (cb) {
							cb();
						}
						uni.hideLoading();
						//关闭导航条加载
						uni.hideNavigationBarLoading();
					});
				});
			},

			newFKPopupClose() {
				this.$refs.newFKPopRef.close()
			},

			gotoJingzhun() {
				this.$refs.newFKPopRef.close()
				wxApi.navigateTo(getPage.jingzhunUser);
			},

			imageAvatar(str) {
				if (str != null && typeof str !== 'undefined' && str != '') {
					if (str.indexOf('http') === 0 || str.indexOf('https') === 0) {
						return str;
					} else if (str.toLowerCase().indexOf('users') === 0) {
						return 'https://keju123.oss-cn-shanghai.aliyuncs.com/' + str + this.thumbSize(100);
					} else {
						return str;
					}
				} else {
					return '';
				}
			},

			goBalance() {
				// #ifdef MP-WEIXIN
				let {
					user_model
				} = this;
				if (!user_model.head_url || !user_model.nickname) {
					$toast('请先完善信息');
					this.$refs.infoRef.open();
				} else {
					wxApi.navigateTo(getPage.userbalance);
				}
				// #endif
			},

			goUserYhk() {
				wxApi.navigateTo(getPage.useryhk);
			},

			goChoujiang() {
				// #ifdef MP-WEIXIN
				wxApi.navigateTo(getPage.choujiang);
				// #endif
			},

			goshopcoupon(e) {
				wxApi.navigateTo(getPage.couponshop, {
					id: e.currentTarget.dataset.id
				});
			},

			thumbSize(str) {
				if (typeof str !== 'undefined') {
					return '?x-oss-process=image/resize,m_fill,h_' + str + ',w_' + str;
				}
			},

			mesclick() {
				// wx.requestSubscribeMessage({
				//   tmplIds: ['3yWycWSutPwvqyqntpigXDBpfgcdgAQyKXoOp_l_0d4'],
				//   success(res) {
				//     console.log(res);
				//   }
				// })
			},

			onChooseAvatar(e) {
				const {
					avatarUrl
				} = e.detail;
				let that = this;
				uploadImage({
					filePath: avatarUrl,
					dir: 'users',
					success(res) {
						that.wxinfo.avatar = res;
					},
					fail(res) {
						$toast(`头像上传失败${res}`);
					}
				});
			},

			wxinputname(e) {
				this.wxinfo.nickname = e.detail.value;
			},

			opentixian() {
				console.log('占位：函数 opentixian 未声明');
			},

			openfenhong() {
				console.log('占位：函数 openfenhong 未声明');
			}
		}
	};
</script>
<style>
	@import './user.css';
</style>
